package leetcode;

public class a226翻转二叉树 {
    TreeNode c;
    public TreeNode invertTree(TreeNode root) {
        if(root==null){
            return root;
        }
        c=root.left;
        root.left=root.right;
        root.right=c;
        if (root.left!=null){
            invertTree(root.left);
        }
        if (root.right!=null){
            invertTree(root.right);
        }
        return root;




    }
}
